import fs from 'fs'
import { resolve } from 'path'

/**获取图片 */
export const getUserImgUrl = (req,res)=>{
      const { type,name } = req.params
      fs.stat(`./assets/${type}/${decodeURIComponent(name)}`,(err)=>{
        if(err) return res.status(404).end()
        res.sendFile(resolve(`./assets/${type}/${decodeURIComponent(name)}`))
     })
}

/**下载app */
export const downloadApp = (req,res)=>{
       res.sendFile(resolve('./assets/application/blog.apk'))
}